Overview
As an Auxiliary User (Grado 2), you are responsible for registering product returns, shortages (faltantes), and surpluses (sobrantes) in the DevolutionSync system. This guide provides step-by-step instructions for creating accurate return records.Access Requirements: You must have Grado 2 (Auxiliary) or Grado 1 (Administrator) privileges to access the registration panel. Contact your system administrator if you need access.
Accessing the Registration Panel
Log in to DevolutionSync
Navigate to the system login page and enter your credentials. Users with
grado = 2 (Auxiliary) or grado = 1 (Admin) can access the registration panel.Open the auxiliary panel
Navigate to
index.php?url=panel/auxiliar or click on the “Registro de Devolución” link in the navigation menu.Understanding the Registration Form
The registration form is organized into logical sections to guide you through the process:Form Sections
-
📦 Gestión de Devoluciones (Header)
- Main title and description
- Success/error alert messages
-
👤 Información del Cliente (Client Information)
- NIT, client name, and delivery address
-
📦 Información del Producto (Product Information)
- Product selection from catalog
- Auto-populated product details
-
⚠️ Detalles de la Devolución (Return Details)
- Return reason, quantities, observations, and evidence
Registering a New Return
Follow this comprehensive workflow to register a product return:Enter client information
Complete the following fields in the Información del Cliente section:NIT Cliente (Required)
- Enter the client’s tax identification number
- Format example:
900123456-7 - This field is mandatory for tracking purposes
- Enter the complete legal name of the client
- Must match official company records
- Enter the complete delivery address
- Include street, city, and any relevant details
Select the product
In the Información del Producto section:Producto (Required)
- Click the dropdown menu to view all available products
- Products are loaded from the
productostable viaProductoModel::listarTodos() - Each option displays:
{item code} - {product description}
- Item Producto: Product item code
- Descripción: Product description
- Unidad: Unit of measurement (UND, CAJA, etc.)
- KG por Unidad: Weight per unit in kilograms
Choose the return reason
In the Detalles de la Devolución section, select the Motivo (reason):
- 🔄 Devolución: Product return (defective, incorrect, etc.)
- ❌ Faltante: Shortage (missing items from delivery)
- ➕ Sobrante: Surplus (extra items in delivery)
The return reason determines how the record is processed and tracked in inventory systems.
Enter quantities
Specify the quantities involved in the return:Cantidad (Unidades) (Required)
- Enter the number of units
- Must be a positive integer (minimum 0)
- Example:
5for 5 units
- This field auto-calculates when you enter units
- Formula:
Units × KG per Unit = Total KG - You can manually override if needed
- Example: If 5 units × 2.5 kg/unit = 12.50 kg
Add observations
In the Observaciones field (required), provide detailed information:
- Describe the reason for the return in detail
- Note the condition of the product
- Include relevant circumstances (delivery issues, client complaints, etc.)
- Reference any supporting documentation
Upload evidence (optional)
Attach photographic evidence of the return:Evidencia Fotográfica (Optional)
- Click “Choose File” to select an image
- Supported formats: JPG, JPEG, PNG, GIF
- Maximum file size: 5 MB
- Images are uploaded to
uploads/evidencias/directory
- File size must not exceed 5 MB
- File extension must be jpg, jpeg, png, or gif
- Files are renamed with unique identifiers:
evidencia_{timestamp}_{uniqid}.{ext}
Submit the registration
Review all information for accuracy, then:
- Click “Registrar Devolución” to submit the form
- A validation check ensures all required fields are complete
- If successful, you’ll see: ✅ “Devolución registrada correctamente. ID de registro generado.”
- The form submits to
index.php?url=panel/registrarvia POST
- Click “Limpiar Formulario” to reset all fields and start over
Form Validation Rules
The system enforces strict validation to ensure data quality:Required Fields (Server-Side)
Validation occurs inPanelController::validarCampos() (lines 109-135):
| Field | Validation Rule |
|---|---|
| nit | Cannot be empty |
| nombre_cliente | Cannot be empty |
| direccion | Cannot be empty |
| producto | Must select a valid product |
| motivo | Must select a return reason |
| cantidad_und | Must be > 0 |
| cantidad_kg | Must be ≥ 0 |
| observacion | Cannot be empty |
Client-Side Validation
JavaScript validation occurs before form submission (lines 259-269):File Upload Validation
Evidence file validation (seePanelController::subirEvidencia(), lines 140-172):
- Maximum size: 5 MB (5,242,880 bytes)
- Allowed formats: jpg, jpeg, png, gif
- Storage location:
uploads/evidencias/ - File naming:
evidencia_{timestamp}_{uniqid}.{extension}
Understanding the Data Flow
When you submit the form, here’s what happens behind the scenes:Form submission
The form sends a POST request to
PanelController::registrar() with all field data and the uploaded file.Success and Error Messages
Success Message
When your return is successfully registered:- The record is created with a unique ID
- Status is set to “Pendiente” (Pending)
- Your username is recorded as
usuario_creador - Timestamp is recorded as
fecha_creacion - The return enters the administrator review queue
Error Messages
Common error messages and their meanings:| Error | Cause | Solution |
|---|---|---|
| ❌ “Debe seleccionar un producto” | No product selected | Choose a product from the dropdown |
| ❌ “Producto no encontrado” | Invalid product code | Contact technical support |
| ❌ “El campo '' es obligatorio” | Required field empty | Complete all mandatory fields |
| ❌ “La cantidad en unidades debe ser mayor a 0” | Zero or negative units | Enter a positive quantity |
| ❌ “El archivo excede el tamaño máximo de 5MB” | File too large | Compress or resize the image |
| ❌ “Formato de archivo no permitido” | Wrong file type | Use JPG, PNG, or GIF format |
| ❌ “Error al subir el archivo de evidencia” | Upload failed | Check file permissions or try again |
| ❌ “Error al guardar en la base de datos” | Database error | Contact technical support |
Error details are logged on the server for troubleshooting. Contact your system administrator if you encounter persistent errors.
Best Practices
Accurate Data Entry
Accurate Data Entry
- Double-check NIT and client name for accuracy
- Verify product selection matches the physical item
- Ensure quantities reflect actual discrepancies
- Use precise measurements for weight calculations
Detailed Observations
Detailed Observations
- Write clear, factual descriptions
- Include relevant context (delivery issues, packaging damage, etc.)
- Note the condition of products clearly
- Reference any client communications
- Mention any immediate actions taken
Quality Evidence
Quality Evidence
- Take clear, well-lit photos
- Capture multiple angles if relevant
- Show product codes or labels clearly
- Include damage or defects prominently
- Keep file sizes under 5 MB (compress if needed)
Timely Registration
Timely Registration
- Register returns as soon as identified
- Don’t batch multiple days of returns
- Create separate records for each unique issue
- Complete forms during business hours when possible
Security and Privacy
Security and Privacy
- Never share your login credentials
- Log out when leaving your workstation
- Verify client information confidentiality
- Don’t modify or delete submitted returns
Form Features and Functionality
Auto-Calculation of Weights
The form includes JavaScript automation to simplify data entry:- Enter the number of units in “Cantidad (Unidades)”
- The
onchangeevent triggerscalcularKgTotal() - Total weight is calculated: Units × KG per Unit
- The “Cantidad (Kilogramos)” field updates automatically
Dynamic Product Information
Product details are dynamically loaded when you select a product:data-descripcion: Product descriptiondata-unidad: Unit of measurementdata-kg: Weight per unit in kilograms
Form Reset
The “Limpiar Formulario” button resets all fields to their default state, allowing you to start a new entry without refreshing the page.Security and Access Control
The auxiliary panel implements security measures:Session Validation
- Users must be logged in
- User grade must be 1 (Admin) or 2 (Auxiliary)
- Unauthorized access redirects appropriately
Data Sanitization
All text inputs are sanitized to prevent XSS attacks:Audit Trail
Every return registration records:usuario_creador: Your username from sessionfecha_creacion: Timestamp of registration (NOW())estado: Set to “Pendiente” by default
Troubleshooting
Form Won’t Submit
- Cause: Missing required fields or validation failure
- Solution: Check for red asterisks (*) marking required fields. Ensure all are completed.
Product Dropdown is Empty
- Cause: No products in database or connection error
- Solution: Contact system administrator to verify product catalog is populated
File Upload Fails
- Cause: File too large, wrong format, or permission issues
- Solution:
- Compress image to under 5 MB
- Convert to JPG, PNG, or GIF
- Contact technical support if issue persists
Auto-Calculation Not Working
- Cause: JavaScript disabled or browser compatibility
- Solution: Enable JavaScript in browser settings, or manually calculate and enter the total KG
Can’t Access Auxiliary Panel
- Cause: Insufficient privileges (grado ≠ 1 or 2)
- Solution: Contact system administrator to verify your account has Auxiliary (Grado 2) or Administrator (Grado 1) access
After Registration
Once you successfully register a return:- Status: The return is created with estado = “Pendiente”
- Queue: It enters the administrator review queue
- Notification: Administrators see it in their pending returns table
- Tracking: The unique ID allows tracking throughout the approval process
- Review: An administrator will review and approve/reject the return
- Updates: You may receive notifications about the review decision
Related Resources
- Administrator Guide - Learn how returns are reviewed
- Consultation Guide - View return history and status
- API Reference - Technical controller documentation
- Database Schema - Return data structure